﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="menulist.aspx.cs" Inherits="Ecreate.Web.popedom.menulist" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
       <link rel="stylesheet" type="text/css" href="/content/css/popedom.css"  />
       <link rel="stylesheet" type="text/css" href="/content/css/tablestyle.css"  />         
       <link rel="stylesheet" type="text/css" href="/content/javascript/XTree25/dhtmlXTree.css"/>   
       <script type="text/javascript"  src="/content/javascript/jquery/jquery-1.3.2.js" ></script>
       <script type="text/javascript" src="/content/javascript/XTree25/dhtmlXCommon.js"></script>
	   <script type="text/javascript" src="/content/javascript/XTree25/dhtmlXTree.js"></script>	
	   <script type="text/javascript" src="/content/javascript/Aspnet.js"></script>		   
	   <script type="text/javascript" language="javascript">
	       function createTree() {
	           tree_productclass = new dhtmlXTreeObject("tree", "100%", "100%", 0);
	           tree_productclass.enableCheckBoxes(1);
	           //tree_productclass.enableSmartCheckboxes(1);
	           tree_productclass.enableThreeStateCheckboxes(false);
	           tree_productclass.attachEvent("onCheck", tree_checked);
	           tree_productclass.setSkin('dhx_skyblue');
	           tree_productclass.setImagePath("/content/javascript/XTree25/imgs/csh_bluefolders/");
	           var xml = "<%=str_xml%>";
	           tree_productclass.setOnClickHandler(tree_productOnclick);
	           tree_productclass.loadXMLString(xml);
	       }
	       function tree_productOnclick(nodeId) {
	           var lastflag = tree_productclass.getUserData(nodeId, "lastflag");
	           if (typeof (lastflag) == "undefined" || lastflag == "") return;
	           if (lastflag == "1") {
	               window.parent.frames["client"].location = "/systemanage/customer/customerlist.aspx?areacode=" + nodeId;
	           }
	       }
	       function tree_checked(id, state) {

	           if (state == '1') {

	               tree_productclass.setSubChecked(id, true);

	           }
	           else {

	               tree_productclass.setSubChecked(id, false);
	           }

	       }
	       function saveMenu() {
	           var menus = tree_productclass.getAllCheckedBranches();
	           var obj = document.getElementById("hid_menus");
	           obj.value = menus;
	           __doPostBack_Net("Button1", menus);
	       }

	       function checkall() {

	           tree_productclass.setSubChecked('0', true);

	       }
	       function uncheckall() {

	           tree_productclass.setSubChecked('0', false);

	       }

	       $(document).ready(function() {
	           createTree();
	       }); 
        </script>                  
</head>
<body>
    <form id="AspNetForm" runat="server">
             <div id="tree">
             </div>	
             
             <div class="eXtremeTable" >
					<table class="tableClass_foot" border="0"  cellspacing="0" cellpadding="0" width="100%">
						<tr>
							<td>
							</td>
							<td align="right">
								<table cellspacing="0" cellpadding="0" width="190">
									<tr>

										<td width="80"  valign="middle" align="right" >
											<a href="javascript:saveMenu();"><img src="/content/image/datagrid_editRow.gif" style="position:relative;top:2px;margin-right:0px;" border="0" alt="" />保存权限</A>
										</td>
										<td width="80"  valign="middle" align="right">
											<a href="javascript:checkall();"><img src="/content/image/datagrid_editRow.gif" style="position:relative;top:2px;margin-right:0px;" border="0" alt="" />全部选中</A>
										</td>
										
										<td width="80"  valign="middle" align="right">
											<a href="javascript:uncheckall();"><img src="/content/image/datagrid_editRow.gif" style="position:relative;top:2px;margin-right:0px;" border="0" alt="" />全部取消</A>
										</td>
										
                                    </tr>
									</table>
							</td>
						</tr>
				  	</table>
				</div>
                <input id="hid_menus" type="hidden" />
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click"  Visible="false"/>
             <asp:HiddenField ID="hid_groupid" runat="server" />
    </form>
</body>
</html>
